package com.stephen.mymall.exception;

import com.stephen.mymall.enums.ResultEnum;
import lombok.Getter;

/**
 * @ author: stephen
 * @ create: 2020-03-17 20:53
 * @ description:
 **/
@Getter
public class ResultException extends RuntimeException {

    private Integer code;

    private Object data;

    public ResultException(String msg) {
        super(msg);
    }

    public ResultException(ResultEnum resultEnum) {
        super(resultEnum.getDescription());
        this.code = resultEnum.getCode();
    }

    public ResultException(ResultEnum resultEnum,Object data) {
        super(resultEnum.getDescription());
        this.data = data;
    }

}
